<%@ tag pageEncoding="UTF-8" %>
<%@ include file="inc/taglibs.jsp" %>
<%@ tag import="org.apache.commons.beanutils.BeanUtils" %>	
<%@ tag import="com.pearlsoft.util.StringUtils" %>

<%-- 通用属性  --%>
<%@ attribute rtexprvalue="true" required="false" name="var"%>
<%@ attribute rtexprvalue="true" required="false" name="id"%>
<%@ attribute rtexprvalue="true" required="false" name="config" 
	description="如果为true，只输出配置项，如果为false，输出内容如new cmpclass(config)，默认为false"%>
<%@ attribute rtexprvalue="true" required="false" name="disabled"%>
<%@ attribute rtexprvalue="true" required="false" name="hidden"%>
<%@ attribute rtexprvalue="true" required="false" name="renderTo"%>
<%@ attribute rtexprvalue="true" required="false" name="scripts"%>
<%@ attribute rtexprvalue="true" required="false" name="styles"%>
<%@ attribute rtexprvalue="true" required="false" name="width" %>
<%@ attribute rtexprvalue="true" required="false" name="height" %>
<%-- UI特性  --%>
<%@ attribute rtexprvalue="true" required="false" name="layout" %>
<%@ attribute rtexprvalue="true" required="false" name="title" %>
<%@ attribute rtexprvalue="true" required="false" name="bodyPadding" %>

<%-- defaults特性  --%>

<%-- 扩展属性  --%>

<%@ attribute rtexprvalue="true" required="true" name="handlerName" %>
<%@ attribute rtexprvalue="true" required="true" name="datasetName" %>
<%@ attribute rtexprvalue="true" required="false" name="handlerURL"  description="表单load时的URL,默认为:/query.asp" %>
<%@ attribute rtexprvalue="true" required="false" name="datasetURL" description="表单submit时的URL,默认为:/dataset.asp"%>
<%@ attribute rtexprvalue="true" required="false" name="handlerMethod" description="表单load时的handlerMethod名称,默认为:handler" %>
<%@ attribute rtexprvalue="true" required="false" name="datasetMethod" description="表单submit时的handlerMethod名称,默认为:handler" %>

<%@ attribute rtexprvalue="true" required="false" name="afterLoadHandler" 
	description="表单load后的回调函数:afterLoadHandler(success,dataset,response, opts)" %>
<%@ attribute rtexprvalue="true" required="false" name="afterSubmitHandler" 
	description="表单submit后的回调函数:afterSubmitHandler(result)" %>


<plsc:component name="Pearlsen.form.PPanel" var="${var}" config="${config}"  >
	<plsc:attr name="id" test="${!empty(id)}">${id}</plsc:attr>
	<plsc:attr name="xtype" test="${config == true}">pform</plsc:attr>
	<plsc:attr name="disabled" test="${!empty(disabled)}" type="boolean" >${disabled}</plsc:attr>
	<plsc:attr name="hidden" test="${!empty(hidden)}" type="boolean" >${hidden}</plsc:attr>		
	<plsc:attr name="renderTo" test='<%=StringUtils.isNotEmpty(renderTo)%>'
		type='<%= StringUtils.getRenderType(renderTo)%>'>${renderTo}</plsc:attr>
	<plsc:attr name="width" test="${!empty(width)}"  type="int" >${width}</plsc:attr>
	<plsc:attr name="height" test="${!empty(height)}"  type="int" >${height}</plsc:attr>
	<plsc:attr name="bodyPadding"  type="int" >${empty(bodyPadding)?5:bodyPadding}</plsc:attr>
	<plsc:attr name="fieldDefaults"   >
		<plsc:value>
			<plsc:attr name="labelAlign"  type="string" >right</plsc:attr>
		</plsc:value>
	</plsc:attr>
	
	
	<%-- UI特性  --%>
	<plsc:attr name="layout" test="${!empty(layout)}">${layout}</plsc:attr>
	<plsc:attr name="title" test="${!empty(title)}" type="string">${title}</plsc:attr>
	<%-- 扩展属性  --%>
	<plsc:attr name="handlerName" test="${!empty(handlerName)}">${handlerName}</plsc:attr>
	<plsc:attr name="datasetName" test="${!empty(datasetName)}">${datasetName}</plsc:attr>
	<plsc:attr name="handlerURL" test="${!empty(handlerURL)}">${handlerURL}</plsc:attr>
	<plsc:attr name="datasetURL" test="${!empty(datasetURL)}">${datasetURL}</plsc:attr>
	<plsc:attr name="handlerMethod" test="${!empty(handlerMethod)}">${handlerMethod}</plsc:attr>
	<plsc:attr name="datasetMethod" test="${!empty(datasetMethod)}">${datasetMethod}</plsc:attr>
	<plsc:attr name="afterLoadHandler" test="${!empty(afterLoadHandler)}"  type="direct" >${afterLoadHandler}</plsc:attr>
	<plsc:attr name="afterSubmitHandler" test="${!empty(afterSubmitHandler)}" type="direct" >${afterSubmitHandler}</plsc:attr>
	
	
	<jsp:doBody/>
</plsc:component>
